/*
 * app_task.h
 *
 *  Created on: 2019年7月3日
 *      Author: yyx
 */

#ifndef APP_APP_TASK_H_
#define APP_APP_TASK_H_

void vRadioOperationTask(void *pvParameters);
void vFlashOperationTask(void *pvParameters);



enum{
    RADIO_SEND = 0,
    RADIO_RECEIVER = 1,
    FLASH_TIME_REMAIN = 2,
    FLASH_PIN_MAP = 3,
};

struct receiver_buffer_s{
   uint8_t lens;
   uint8_t buff[64];
   uint8_t used;
   int8_t rssi;
};

typedef struct radio_operation_s {
  uint8_t type;
  union{
    struct
    {
        void* buff;
        uint8_t reserve[2];
    }radio_rx;
    struct
    {
        uint8_t sn[4];
        uint8_t index;
        uint8_t action;
    }radio_tx;
  };
}radio_operation_t;


typedef struct flash_operation_s {
  uint8_t type;
  union{
    uint32_t port;
    uint32_t time_remain;
  };
}flash_operation_t;


void rf_msg_receiver_success_notify(radio_operation_t oper);
void rf_msg_send_notify(radio_operation_t oper);
void rf_msg_send_success_notify(void);
void rf_msg_send_wait_success(void);
void flash_operation_notify_from_ISR(flash_operation_t oper);
void flash_operation_notify(flash_operation_t oper);
#endif /* APP_APP_TASK_H_ */
